#!/usr/bin/env python

import os
import sys

sys.path.append(os.path.join(os.path.dirname(__file__), '..'))
from runtest_dalton import Filter, TestRun

#   CPS(D) energy
#   -----------
#   Molecule:         Ethylene
#   Wave Function:    MP3 / 6-31G
#   Test Purpose:     MP3 energy corrections check with symmetry and frozen core

test = TestRun(__file__, sys.argv)

f = Filter()

#
# Test of MP3 energy
#
f.add(from_string = 'STARTING MP3 CALCULATION',
     to_string = 'END OF COUPLED CLUSTER CALCULATION',
     rel_tolerance = 1.0e-9)

f.add(string = 'MP2 correction:',
      rel_tolerance = 1.0e-9)

f.add(string = 'Total MP2 energy:',
      rel_tolerance = 1.0e-9)

f.add(string = 'MP3 correction:',
      rel_tolerance = 1.0e-9)

f.add(string = 'Total MP3 energy:',
      rel_tolerance = 1.0e-9)

test.run(['mp3_energy_sym.dal'], ['mp3_energy_sym.mol'], f={'out': f},
         accepted_errors=['not implemented for parallel calculations.'])

sys.exit(test.return_code)
